package cn.waxcc.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @program: springboot-medicalapp
 * @ClassName AccessControlAllowOriginFilter
 * @description:
 * @author: JYF
 * @create: 2023-03-29 21:49
 * @Version 1.0
 */
@Configuration
public class AccessControlAllowOriginFilter implements WebMvcConfigurer {

    @Override
    public void addCorsMappings(CorsRegistry registry){
        registry.addMapping("/*/**")
                .allowedHeaders("*")
                .allowedMethods("*")
                .maxAge(1800)
                .allowedOrigins("*");
    }


}